#include <iostream>

void address_example() {
    std::cout << "\n ";

    int i = 5;
    std::cout << i << " " << &i << std::endl;

    std::cout << std::endl;

}

#include <memory>

void addressof_example() {
    std::cout << "\n ";

    int i = 5;
    std::cout << i << " " << std::addressof(i) << std::endl;

    std::cout << std::endl;
}

void uninitialized_variable_address() {
    std::cout << "\n ";
    
    int i;
    std::cout << &i << std::endl;

    std::cout << std::endl;
}

void temporary_data_address() {
    std::cout << "\n ";
    
    int i = 5;
    // std::cout << &(i + 2) << std::endl;

    std::cout << std::endl;
}

#include <cstdint>

void address_to_number_example() {
    std::cout << "\n ";

    int i = 5;
    uintptr_t address = reinterpret_cast<uintptr_t>(&i);
    std::cout << i << " " << &i << " " << address << std::endl;

    std::cout << std::endl;

}

int main() {
    if (false) address_example();
    if (false) addressof_example();
    if (false) uninitialized_variable_address();
    if (true) address_to_number_example();

    return 0;
}